﻿<%@ Page Language="C#" MasterPageFile="~/WebSite.Master" AutoEventWireup="true" CodeBehind="List.aspx.cs"
    Inherits="RN.ERP.Web.Material.MaterialProperty.List" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" src="../../Scripts/ligerUI/js/ligerui.min.js"></script>
    <script type="text/javascript">
        function OpenAlert(text) {
            $.ligerDialog.warn(text);
            return false;
        }
        /*打开添加窗口*/
        function AddOrEditKC(type, mpid) {
            var url, title;
            if (type == 0) {//添加
                url = "./Info.aspx?type=0";
                title = "添加信息";
            }
            else if (type == 1) {//查看
                url = "./Info.aspx?type=1&mpid=" + mpid;
                title = "详细信息";
            }
            else if (type == 2) {//修改
                //                var chk = $("input:checked");
                //                if (chk.length == 0) {
                //                    OpenAlert("请选择要修改的信息！");
                //                    return false;
                //                }
                //                else {
                url = "./Info.aspx?type=2&mpid=" + mpid;
                title = "修改信息";
                //                }
            }
            else {
                url = "./Info.aspx?type=3&id=" + mpid;
                title = "添加信息";
            }
            $.ligerDialog.open({ url: url, width: 600, height: 400, title: title, allowClose: false, buttons: [{ text: '关闭', onclick: function (item, dialog) { dialog.close(); } }] });
        }
        function RefreshWin() {
            location.href = location.href;
        }
        function CloseWin(data) {
            if (data == "1") {
                RefreshWin();
            }
        }
        function KCInfo() {
            var chk = $("input:checked");
            if (chk.length == 0) {
                OpenAlert("请选择要导出的信息！");
                return false;
            }
            else {

                return false;
            }
        }
        function ShowLog(id) {
            var url = "../MaterialLog.aspx?id=" + id + "&fid=MaterialProperty";
            var title = "查看日志";
            $.ligerDialog.open({ url: url, width: 600, height: 600, title: title, allowClose: false, buttons: [{ text: '关闭', onclick: function (item, dialog) { dialog.close(); } }] });
        }
        $(function () {
            //            $(".a_del").click(function () {
            //                var chk = $("input:checked");
            //                if (chk.length == 0) {
            //                    OpenAlert("请选择要删除的信息！");
            //                    return false;
            //                }
            //                else {
            //                    $.ligerDialog.confirm("确定删除？", DeleteKC);
            //                    return false;
            //                }
            //            });
            $('input[type="checkbox"]').click(function () {
                if ($(this).attr('checked')) {
                    $('input[type="checkbox"]').removeAttr('checked');
                    $(this).attr('checked', 'checked');
                }
            });
        })
        function DeleteKC(id) {
            //            if (arg) {
            //                var chk = $("input:checked");
            //                var id = chk.eq(0).val();
            if ($.ligerDialog.confirm("确定删除？")) {
                $.ajax({
                    async: false,
                    url: "List.aspx/DelKC",
                    data: "{ 'id':'" + id + "'}",
                    type: "post",
                    cache: false,
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (data) {
                        var json = eval('(' + data.d + ')');
                        $.ligerDialog.warn(json.Message, "", RefreshWin);
                    }
                });
            }

            //            }
        }
    </script>
    <style type="text/css">
        
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <link type="text/css" href="../../CSS/base.css" rel="Stylesheet" />
    <link type="text/css" href="../../CSS/global.css" rel="Stylesheet" />
    <link type="text/css" href="../../CSS/style.css" rel="Stylesheet" />
    <asp:HiddenField ID="hdnClassCode" runat="server" />
    <table width="100%" style="table-layout: fixed; margin-top: 5px;" border="0" cellspacing="0"
        cellpadding="0" align="center">
        <tr>
            <td class="xx_m  tt_xx_l">
            </td>
            <td class="xx_m  tt_xx_icon">
            </td>
            <td style="width: auto;" class="xx_m">
                物资属性类别列表
            </td>
            <td style="width: 14px;">
                <img src="../../images/xx_r.jpg" width="14" height="33" />
            </td>
        </tr>
        <tr>
            <td class="left_con">
                &nbsp;
            </td>
            <td colspan="2" style="padding-left: 6px; padding-right: 6px;" valign="top">
                <div>
                    <div class="xian">
                        <div class="about_title">
                            物资属性类别列表</div>
                    </div>
                    <div class="x clearfix fn-left">
                        <div class="crm_toolbar_left">
                        </div>
                        <div class="crm_toolbar_center">
                            <ul class="crm_action">
                                <li><a href="javascript:;" class="ActionA RecordNew" id="add" onclick="AddOrEditKC(0,0)">
                                    新建</a></li>
                                <li><a href="javascript:;" class="ActionA RecordImport" id="action_2" onclick="loadModuleJsOp('4', '0', Import, ['005'], '005');return false;">
                                    导入</a></li>
                                <li><a href="javascript:;" class="ActionA RecordExport" id="action_3" onclick="loadModuleJsOp('4', '0', Export, ['006'], '006');return false;">
                                    导出</a></li>
                            </ul>
                        </div>
                        <div class="crm_toolbar_right">
                        </div>
                    </div>
                    <telerik:radgrid id="RadGridList" runat="server" showstatusbar="True" allowsorting="True"
                        cssclass="tab" cellspacing="0" culture="zh-CN" gridlines="None" allowpaging="True"
                        allowcustompaging="True" onneeddatasource="RadGrid1_NeedDataSource" width="100%"
                        onitemcommand="RadGridList_ItemCommand">
                        <MasterTableView AutoGenerateColumns="false" DataKeyNames="ID" NoMasterRecordsText="暂无数据"
                            InsertItemPageIndexAction="ShowItemOnCurrentPage" CommandItemDisplay="Top">
                            <CommandItemSettings ExportToPdfText="Export to PDF" />
                            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="true">
                            </RowIndicatorColumn>
                            <EditFormSettings>
                                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                </EditColumn>
                            </EditFormSettings>
                            <PagerStyle AlwaysVisible="True" />
                            <CommandItemTemplate>
                            </CommandItemTemplate>
                            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True">
                            </ExpandCollapseColumn>
                            <Columns>
                                <telerik:GridTemplateColumn HeaderText="选择" UniqueName="Choose" HeaderStyle-Width="5%"
                                    HeaderStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <input id="ckbChoose" type="checkbox" value='<%#Eval("ID") %>' runat="server" />
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center" Width="5%"></HeaderStyle>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="属性类码" HeaderStyle-Width="10%" HeaderStyle-HorizontalAlign="Center"
                                    FilterControlAltText="Filter MPCodeColumn column" UniqueName="MPCode">
                                    <ItemTemplate>
                                        <%# Eval("cMPCode")%>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center" Width="10%"></HeaderStyle>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="属性名称" HeaderStyle-Width="15%" HeaderStyle-HorizontalAlign="Center"
                                    FilterControlAltText="Filter  MPNamecolumn" UniqueName="MPName">
                                    <ItemTemplate>
                                        <%# Eval("cMPName")%>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center" Width="15%"></HeaderStyle>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="说明" UniqueName="Memo" HeaderStyle-Width="20%"
                                    HeaderStyle-HorizontalAlign="Center" FilterControlAltText="Filter Memocolumn">
                                    <ItemTemplate>
                                        <%# Eval("cMemo")%>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center" Width="20%"></HeaderStyle>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="添加时间" UniqueName="Memo" HeaderStyle-Width="15%"
                                    HeaderStyle-HorizontalAlign="Center" FilterControlAltText="Filter Memocolumn">
                                    <ItemTemplate>
                                        <%# Eval("dCDate")%>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center" Width="15%"></HeaderStyle>
                                </telerik:GridTemplateColumn>
                                <%--<telerik:GridBoundColumn HeaderText="状态" UniqueName="Status" HeaderStyle-Width="5%"
                                    HeaderStyle-HorizontalAlign="Center" FilterControlAltText="Filter Status column">
                                    <HeaderStyle HorizontalAlign="Center" Width="15%"></HeaderStyle>
                                </telerik:GridBoundColumn>--%>
                                <%--<telerik:GridTemplateColumn FilterControlAltText="Filter Info column" HeaderText=""
                                    UniqueName="Info">
                                    <HeaderStyle Width="30%" />
                                </telerik:GridTemplateColumn>--%>
                                <telerik:GridTemplateColumn HeaderText="操作" HeaderStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="btnGo" runat="server" CssClass="ActionA RecordNew" CommandName="go"
                                            CommandArgument='<%# Eval("ID") %>' title="设置子属性"></asp:LinkButton>
                                        <asp:LinkButton ID="btnDel" runat="server" CssClass="ActionA RecordDel" OnClientClick="return confirm('确定删除？');"
                                            CommandName="del" CommandArgument='<%# Eval("ID") %>'  title="删除"></asp:LinkButton>
                                        <span id="edit" runat="server"><a style="cursor: pointer;" onclick="AddOrEditKC(2,<%#Eval("ID") %>);"
                                            class="ActionA RecordEdit"  title="编辑"></a></span><span id="Span2" runat="server"><a style="cursor: pointer;" onclick="ShowLog(<%#Eval("ID") %>);"
                                            class="ActionA RecordHistory"  title="日志信息"></a></span>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                            </Columns>
                        </MasterTableView>
                        <ClientSettings EnableRowHoverStyle="true">
                            <Selecting AllowRowSelect="True"></Selecting>
                        </ClientSettings>
                        <PagerStyle AlwaysVisible="True" />
                        <FilterMenu EnableImageSprites="False">
                        </FilterMenu>
                    </telerik:radgrid>
                </div>
            </td>
            <td class="right_con">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td class="con_m tt_left_bottom">
                &nbsp;
            </td>
            <td colspan="2" class="con_m">
                &nbsp;
            </td>
            <td class="tt_right_bottom">
                &nbsp;
            </td>
        </tr>
    </table>
    <div id="UDialog" style="margin: auto; width: 900px;">
        <telerik:radajaxloadingpanel runat="server" id="gridLoadingPanel">
        </telerik:radajaxloadingpanel>
        <telerik:radwindowmanager id="RadWindowManager1" runat="server" enableshadow="true">
            <Windows>
                <telerik:RadWindow ID="UserDialog" runat="server" Title="考场信息" Height="700px" Behaviors="Close"
                    Width="600px" Left="150px" ReloadOnShow="true" ShowContentDuringLoad="false"
                    Modal="true" Skin="WebBlue" VisibleStatusbar="False" CssClass="DialogCss">
                </telerik:RadWindow>
            </Windows>
        </telerik:radwindowmanager>
    </div>
</asp:Content>
